<template>
    <!-- 最外层只能有一个组件，不能出现多个 -->
    <!-- 最外层class命名规则 工程-文件路径-文件名  -->
    <div class="">
        {{newData}}
        <button @click="changeData">改变数据</button>

    </div>
</template>

<script>
    export default {
        props:{
            value: "",
        },
        data: function (){
            return {
                newData:"",
            }
        },
        mounted: function(){
            console.log("this.value : " + this.value);
        },
        methods: {
            changeData : function (){
                this.newData = new Date().getTime() + "----" + this.value;
                this.$emit("input",this.newData);
            }
        },
        watch: {
            input:function (newValue, oldValue) {
                console.log("watch input" + newValue);
            }
        }
    }
</script>

<style lang="scss" scoped>
</style>
